package com.arpgalaxy.generator;

import com.arpgalaxy.generator.core.ArpGenerator;
import com.arpgalaxy.generator.core.ArpGeneratorFacade;
import com.arpgalaxy.generator.entity.Properties;
import com.arpgalaxy.generator.entity.TypeConverter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class GeneratorApplication {
    @Autowired
    Properties properties;
    @Autowired
    TypeConverter typeConverter;

    @Bean
    @ConditionalOnBean(Properties.class)
    public ArpGeneratorFacade arpGeneratorFacade(){
        ArpGenerator arpGenerator = new ArpGenerator();
        arpGenerator.executeGenerator(properties,typeConverter);
        return new ArpGeneratorFacade();
    }
    public static void main(String[] args) {
        SpringApplication.run(GeneratorApplication.class, args);
    }

}
